#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QPushButton>
#include <QLineEdit>

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    QPushButton *pButton1 = ui->pushButton;
    QPushButton *pButton2 = ui->pushButton_2;
    QPushButton *pButton3 = ui->pushButton_3;

    QLineEdit *pLineEdit1 = ui->lineEdit;
    QLineEdit *pLineEdit2 = ui->lineEdit_2;
    QLineEdit *pLineEdit3 = ui->lineEdit_3;

    pButton1->setText("1");
    pButton2->setText("3");
    pButton3->setText("5");

    pLineEdit1->setText("6");
    pLineEdit2->setText("4");
    pLineEdit3->setText("2");

    // 设置焦点切换顺序
    QWidget::setTabOrder(pButton1, pLineEdit3);
    QWidget::setTabOrder(pLineEdit3, pButton2);
    QWidget::setTabOrder(pButton2, pLineEdit2);
    QWidget::setTabOrder(pLineEdit2, pButton3);
    QWidget::setTabOrder(pButton3, pLineEdit1);
    pButton2->setFocusPolicy(Qt::NoFocus);
    pLineEdit2->setFocusPolicy(Qt::NoFocus);
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::on_pushButton_clicked()
{

}
